Allow overriding CompletionHandler, InitHandler, WorkspaceDiagnosticsHandler - #3719
Allow overriding CompletionHandler, InitHandler, WorkspaceDiagnosticsHandler#3719trancexpress wants to merge 3 commits into
Conversation
|
Since the plan is to keep having a single jdt.ls instance running, I don't see how those changes would help. Instead I think we should rather have a mechanism to register init, completion, [...whatever] participants, that would augment the existing jdt.ls behavior |
|
Can one of the admins verify this patch? |
The full set of changes so far is here: trancexpress@578383c The entry point would be in the application, by extracting: An example application that overrides the respective bits would then be: Then
Sounds great! What do you have in mind for the registration mechanism? A plain method, Eclipse extensions, something else? For completion and diagnostics we would need some way to merge all completions/diagnostics? For diagnostics I'm not sure how we communicate that existing diagnostics should be deleted, when there are multiple handlers. E.g. For the init handler we would need the |
|
@fbricon could you let me know what you have in mind?
|
…Handler This change opens up CompletionHandler, InitHandler and WorkspaceDiagnosticsHandler for extension, so that the classes can be re-used. See: eclipse-jdtls#3718
|
I've pushed all the changes we need so far, to override handlers. As well as prevent overriding JDT preferences, in our case we want the same preferences as our Eclipse application. We can also rely on a preference for this, it doesn't need to be a VM property. Regardless of the registration mechanism for handlers, we would like to re-use as much code from JDT LS as possible. If we would just add registration mechanisms, we would need to copy a lot of code. And then there are cases like the Does the full set of changes make our intent/proposal more clear? As mentioned above, the application we would start is: Bits are overridden with: |
|
@trancexpress if I understand correctly your need, you want to customize
some lsp features like completion and validation.
We did that in LSP4MP by using jdt ls IDelegateCommandHandler here rhis
delegate command handler
https://github.com/eclipse-lsp4mp/lsp4mp/blob/master/microprofile.jdt%2Forg.eclipse.lsp4mp.jdt.core%2Fsrc%2Fmain%2Fjava%2Forg%2Feclipse%2Flsp4mp%2Fjdt%2Finternal%2Fcore%2Fls%2FMicroProfileDelegateCommandHandlerForJava.java
This command handler is based on java features extension points to add
custom validation etc.
We have a language server which consumes those custom command for
completion, diagnostics
If you could be interrsted and need more info please ask m
|
|
Thank you @angelozerr , I'll take a look! |
You are welcome! And if you like the idea, we are in discussion with Liberty Tools team to provide a dedicaced plugin which provides those lsp features extension point. |
|
We'll continue with patching JDT LS until we have a more clear picture of what we need. |
|
@trancexpress sorry I'm just back from PTO today. So essentially what jdt.ls would allow, would be an Eclipse extension points to contribute participants, somewhat similar to #3732 |
|
Alright, thank you @fbricon! Once we have implemented the required features, we'll likely try to add such extensions. If I find time earlier, I'll also try just for the handlers here - since we definitely need them. |
This change opens up
CompletionHandler,InitHandlerandWorkspaceDiagnosticsHandlerfor extension, so that the classes can be re-used.Fixes: #3718